﻿@page "/loopcontrol"
@using BootstrapBlazor.Components
@using TrackSystem.UI.Server.Units

<div class="row g-3">
    <div class="col-6 col-sm-4 col-md-3 col-lg-auto">
        <Button OnClick="@BtnInitLoop" Color="Color.Primary">载入控制回路</Button>
    </div>

    <div class="col-6 col-sm-4 col-md-3 col-lg-offset-3">
        <Button OnClick="@BtnUnloadLoop" Color="Color.Info">卸载控制回路</Button>
    </div>


    <div class="col-6 col-sm-4 col-md-3 col-lg-offset-3">
        <Dropdown TValue="string" Items="loopNameItems" OnSelectedItemChanged="@SelectLoopHandle" Color="Color.Secondary"></Dropdown>
    </div>
</div>

@if (_loopItem is not null)
{
    <Divider></Divider>
    <LoopView loop="_loopItem" hub="_hubIo"></LoopView>
}

<Divider />
<p>@_message</p>
